package com.xm.shop.service.impl;

import com.xm.shop.mapper.AddressMapper;
import com.xm.shop.pojo.entity.Address;
import com.xm.shop.pojo.qo.AddressAddQO;
import com.xm.shop.pojo.qo.AddressStatusQO;
import com.xm.shop.pojo.qo.AddressUpdateQO;
import com.xm.shop.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ludi
 * @date:2020/9/1 16:06
 * @description:地址业务
 */
@Service
public class AddressServiceImpl implements AddressService {
    @Autowired
    private AddressMapper addressMapper;
    @Override
    public List<Address> selectAddressByUserId(Integer userId) {
        return addressMapper.selectAddressByUserId(userId);
    }

    @Override
    public Integer addAddress(AddressAddQO addressAddQO) {
        return addressMapper.addAddress(addressAddQO);
    }

    @Override
    public Integer deleteAddress(Integer addressId) {
        return addressMapper.deleteAddress(addressId);
    }

    @Override
    public Integer updateAddress(AddressUpdateQO addressUpdateQO) {
        return addressMapper.updateAddress(addressUpdateQO);
    }

    @Override
    public Integer updateStatus(AddressStatusQO addressStatusQO) {
        return addressMapper.updateStatus(addressStatusQO);
    }
}
